var myAlert = (function() {
	//alert　
	var alert = function(msg,callback) {
		var str = '<div class="myAlert_container"></div>'+
			'<div class="myAlert_content">'+
			'<div class="myAlertContent_line1">'+msg+'</div>'+
			'<div class="myAlertContent_line2">确定</div></div>';
		$('body').append(str);
		if(callback) {
			callback();
		}
		$('.myAlertContent_line2').on('click',function(){
			$('.myAlert_container').hide();
			$('.myAlert_content').hide();
		})
		$('.myAlert_container').on('click',function(){
			$('.myAlert_container').hide();
			$('.myAlert_content').hide();
		})
	};
	var confirm = function(msg, callback) {
		var str = '<div class="myAlert_container"></div>'+
			'<div class="myAlert_content">'+
			'<div class="myConfirm_line1">'+msg+'</div>'+
			'<div class="myConfirm_line2">'+
				'<div class="myConfirm_cancle">取消</div>'+
				'<div class="myConfirm_ok">确定</div></div>';
		
		$('body').append(str);
		$('.myConfirm_cancle').on('click',function(){
			$('.myAlert_container').hide();
			$('.myAlert_content').hide();
		})
		$('.myAlert_container').on('click',function(){
			$('.myAlert_container').hide();
			$('.myAlert_content').hide();
		})
		$('.myConfirm_ok').on('click',function(){
			if(callback) {
				console.log(callback);
				callback();
			}else{};
			$('.myAlert_container').hide();
			$('.myAlert_content').hide();
		})
 	};
	return {
		alert: alert, 
		confirm: confirm, 
	};
})();